package com.jt.com.jt.provider.service;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 注意此方法中的异常类型必须为BlockException(他是所有降级异常的父类)
 */
@Slf4j
@Component
public class ResourceBlockHandler {
    public static String call(BlockException ex){
        log.error("service exiption {}" ,ex.getMessage());
        return "访问太频繁，稍等片刻在访问";
    }
}
